<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of serviceAplication
 *
 * @author CESAR QUEVEDO
 */
class serviceAplication {

    
    public function addAplicaction($nameAplication)
    {
        
        $newAplication = new ListaProgramasMonitoreo();
        $newAplication->setNombrePrograma($nameAplication);
        $newAplication->setNombreSistema(strtolower($nameAplication).'.exe');
        $newAplication->setEstado("H");
        $newAplication->save();

    }
    
    public function buscarAplicacion($nameAplication)
    {
         $criteria = new Criteria();
         $criteria->add(ListaProgramasMonitoreoPeer::NOMBRE_SISTEMA,strtolower($nameAplication).'.exe');
         $aplication = ListaProgramasMonitoreoPeer::doSelectOne($criteria);
         if(is_object($aplication))
         {
             return array("success" =>true , "message" =>"objecto encontrado" , "object" => $aplication );
         }
         else
         {
             return array("success" =>false , "message" =>"objecto no encontrado" , "object" => null );
         }
    }

}
?>
